export interface IOption {
  viewWidth: number;// 可视区域宽度
  viewHeight: number;// 可视区域高度
  preRenderRatio: number;// 预渲染比例，viewWidth * preRender 为最终渲染弄得宽度
  itemWidth: number; // 单个元素的高
  itemHeight: number; // 单个元素的宽
  header?: IHeader[]; // 表头
  fixed?: number; // 可视区域y方向固定数
  transposition?: boolean; //是否转置
}

export interface IViewInfo extends IOption {
  x: number; // 二维数组总宽度
  y: number; // 二维数组总高度
}

export interface IOffset {
  // 虚拟滚动位移量
  x: number;
  y: number;
}

export enum STATUS { // 单元格状态
  zero = 0b0000,
  one = 0b1111,
  selected = 0b0001,
  shift = 0b0010,
  current = 0b0100,
  editor = 0b1000
}

export enum KEYS { // 按键状态
  zero = 0b00000000,
  Control = 0b00000001,
  Alt = 0b00000010,
  Shift = 0b00000100,
  ArrowUp = 0b00001000,
  ArrowDown = 0b00010000,
  ArrowLeft = 0b00100000,
  ArrowRight = 0b01000000,
  Enter = 0b10000000
}

export interface IHeader {
  data: string; //数据
  dataAlign?: "center" | "left" | "end";
  index: number; // 列序号
  width: number; // 列宽
  children?: any[]; // 多表头
  dataType?: {
    type: DATATYPE;
    param?: number | string;
  }; // 数据类型
  sorter?: () => void;
  sortType?: "desc" | "asc" | "";
}

export enum DATATYPE {
  number = 0b00000001,
  string = 0b00000010,
  time = 0b00000100
}

export interface IDataItem {
  x: number;
  y: number;
  data: any; //数据元素
  status?: STATUS; //状态
}
